#include<iostream>
using namespace std;

int findMinNum(int* Arr,int n){
    int MinList[n+2]={0}, i;
    for (i = 0; i < n; i++) if(0< Arr[i]<= n+2) MinList[Arr[i]]=1;
    i=1;
    while (MinList[i]) i++;
    return i;
}

int main(int argc, char const *asrgv[])
{
    // int a[3] = {1,2,3};
    int a[4] = {-5,3,2,3};
    findMinNum(a,4);
    return 0;
}
